#(last performed on Monday, October 6, 2003 on R version 1.6.2)
##Load the data.  We subset out DC because the DS database does not
##include television ad cost thereby excluding it from the regressions
##that DS does.
data <- read.csv("M:/replication/reassessment/reassessment.csv")
data<-subset(data, STATE!="DC") # Shaw (1999) does not actually include DC in its analysis

##create the competiveness variable (see top of page 905 for a
##description of this variable.)
data$COMP <- 50-(abs(50- data$STATEAVE))

## create the TV ad cost variable
## data$TVADCOST <- 10/(data$BUYCOST*10)
data$TVADCOST <- 1/(data$BUYCOST*.0001)

##recode strat variables per Shaw (1999, p. 905)
data$REPSTRAT.NEW[data$REPSTRAT == 1] <- 0
data$REPSTRAT.NEW[data$REPSTRAT == 2] <- 1
data$REPSTRAT.NEW[data$REPSTRAT == 3] <- 2
data$REPSTRAT.NEW[data$REPSTRAT == 4] <- 1
data$REPSTRAT.NEW[data$REPSTRAT == 5] <- 0
data$DEMSTRAT.NEW[data$DEMSTRAT == 1] <- 0
data$DEMSTRAT.NEW[data$DEMSTRAT == 2] <- 1
data$DEMSTRAT.NEW[data$DEMSTRAT == 3] <- 2
data$DEMSTRAT.NEW[data$DEMSTRAT == 4] <- 1
data$DEMSTRAT.NEW[data$DEMSTRAT == 5] <- 0
attach(data)
